package com.chinabank.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import com.chinabank.dao.GroupDao;
import com.chinabank.model.Group;


@Repository
public class GroupDaoImpl extends BaseDaoImpl<Group> implements GroupDao{

	@Override
	public Group get(Serializable id) {
		return this.get(Group.class, id);
	}

	@Override
	public List<Group> getGroups() {
		Session session = this.getSessionFactory().getCurrentSession();
		String hql = "from Group";
		List<Group> groups = (List<Group>)session.createQuery(hql).list();
		return groups;
	}


}
